/* 
 * TreeUI v1.03
 * 2019/02/20
 */
if (typeof jQuery === 'undefined') {
  alert("TreeUI need jQuery!");
}

$(function(){
	//折叠效果
    $("body").on("click",".toggle",function () {
        var todiv = $(this).attr("data-toggle");
        var totime = $(this).attr("data-toggle-time");
        $(todiv).fadeToggle(totime);
    });
    $("body").on("click",".fadetoggle",function () {
        var todiv = $(this).attr("data-toggle");
        var totime = $(this).attr("data-toggle-time");
        $(todiv).fadeToggle(totime);
    });
    $("body").on("click",".slidetoggle",function () {
        var todiv = $(this).attr("data-toggle");
        var totime = $(this).attr("data-toggle-time");
        $(todiv).fadeToggle(totime);
    });
	//遮罩层效果
	$(".masktoggle").click(function(){
		var totime=$(this).attr("data-toggle-time");
		$("#overlay").height($(window).height());
		$("#overlay").width($(window).width());
		$("#overlay").fadeToggle(totime);
		$(window).resize(function(){
		$("#overlay").height($(window).height());
		$("#overlay").width($(window).width());
		});
	});
	//条纹表格
	$(".table-striped tr:nth-child(even)").addClass("striped");
	//提示框
	$(".tips-close").click(function() {
        $(".tips").hide();
    });
});
//全屏效果,IE不是很兼容
function Fullscreen() { 
	var docElm = document.documentElement;  
	//W3C   
	if (docElm.requestFullscreen) {  
		docElm.requestFullscreen();  
	}  
	//FireFox   
	else if (docElm.mozRequestFullScreen) {  
		docElm.mozRequestFullScreen();  
	}  
	//Chrome等   
	else if (docElm.webkitRequestFullScreen) {  
		docElm.webkitRequestFullScreen();  
	}  
	//IE11   
	else if (elem.msRequestFullscreen) {  
		elem.msRequestFullscreen();  
	}
}; 
function Defaultscreen() { 
	if (document.exitFullscreen) {  
		document.exitFullscreen();  
	}  
	else if (document.mozCancelFullScreen) {  
		document.mozCancelFullScreen();  
	}  
	else if (document.webkitCancelFullScreen) {  
		document.webkitCancelFullScreen();  
	}  
	else if (document.msExitFullscreen) {  
		document.msExitFullscreen();  
	}  
};
